package com.hmall.common.config;


import com.hmall.common.interceptor.UserInfoInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Acer
 */

public class MvcConfig implements WebMvcConfigurer {

    /**
     * 添加拦截器
     * @Bean*/
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new UserInfoInterceptor())
                .addPathPatterns("/**");
    }
}
